"use strict"
var MK = MK || function () { };
MK.ModelKit = MK.ModelKit || function () { };
MK.ModelKit.account = {};
MK.ModelKit.Model = function () {
    "use strict";
    var accountModel = {};
    if (!MK.ModelKit) {
        Xrm.Utility.alertDialog("MK.ModelKit is not present.");
        return;
    };
    MK.ModelKit.EntityProperty(accountModel)
    accountModel.form = {};
    MK.ModelKit.UI.FormProperty(accountModel.form)
    accountModel.fields = {};
    var fieldList = [];


    fieldList.push({ logicalname: "emailaddress3", type: "String" });
    fieldList.push({ logicalname: "emailaddress2", type: "String" });
    fieldList.push({ logicalname: "emailaddress1", type: "String" });
    fieldList.push({ logicalname: "slaid", type: "Lookup" });
    fieldList.push({ logicalname: "modifiedon", type: "DateTime" });
    fieldList.push({ logicalname: "aging90", type: "Money" });
    fieldList.push({ logicalname: "overriddencreatedon", type: "DateTime" });
    fieldList.push({ logicalname: "websiteurl", type: "String" });
    fieldList.push({ logicalname: "donotpostalmail", type: "Boolean" });
    fieldList.push({ logicalname: "openrevenue", type: "Money" });
    fieldList.push({ logicalname: "sharesoutstanding", type: "Integer" });
    fieldList.push({ logicalname: "donotsendmm", type: "Boolean" });
    fieldList.push({ logicalname: "creditonhold", type: "Boolean" });
    fieldList.push({ logicalname: "aging30", type: "Money" });
    fieldList.push({ logicalname: "donotbulkpostalmail", type: "Boolean" });
    fieldList.push({ logicalname: "utcconversiontimezonecode", type: "Integer" });
    fieldList.push({ logicalname: "slainvokedid", type: "Lookup" });
    fieldList.push({ logicalname: "opendeals_date", type: "DateTime" });
    fieldList.push({ logicalname: "originatingleadid", type: "Lookup" });
    fieldList.push({ logicalname: "accountcategorycode", type: "Picklist" });
    fieldList.push({ logicalname: "territoryid", type: "Lookup" });
    fieldList.push({ logicalname: "aging60_base", type: "Money" });
    fieldList.push({ logicalname: "onholdtime", type: "Integer" });
    fieldList.push({ logicalname: "creditlimit", type: "Money" });
    fieldList.push({ logicalname: "openrevenue_base", type: "Money" });
    fieldList.push({ logicalname: "preferredappointmenttimecode", type: "Picklist" });
    fieldList.push({ logicalname: "numberofemployees", type: "Integer" });
    fieldList.push({ logicalname: "accountclassificationcode", type: "Picklist" });
    fieldList.push({ logicalname: "revenue", type: "Money" });
    fieldList.push({ logicalname: "customertypecode", type: "Picklist" });
    fieldList.push({ logicalname: "exchangerate", type: "Decimal" });
    fieldList.push({ logicalname: "isprivate", type: "Boolean" });
    fieldList.push({ logicalname: "primarycontactid", type: "Lookup" });
    fieldList.push({ logicalname: "telephone3", type: "String" });
    fieldList.push({ logicalname: "parentaccountid", type: "Lookup" });
    fieldList.push({ logicalname: "statuscode", type: "Status" });
    fieldList.push({ logicalname: "createdon", type: "DateTime" });
    fieldList.push({ logicalname: "donotbulkemail", type: "Boolean" });
    fieldList.push({ logicalname: "donotfax", type: "Boolean" });
    fieldList.push({ logicalname: "marketcap", type: "Money" });
    fieldList.push({ logicalname: "ownershipcode", type: "Picklist" });
    fieldList.push({ logicalname: "opendeals_state", type: "Integer" });
    fieldList.push({ logicalname: "owningbusinessunit", type: "Lookup" });
    fieldList.push({ logicalname: "lastusedincampaign", type: "DateTime" });
    fieldList.push({ logicalname: "processid", type: "Uniqueidentifier" });
    fieldList.push({ logicalname: "description", type: "Memo" });
    fieldList.push({ logicalname: "modifiedby", type: "Lookup" });
    fieldList.push({ logicalname: "timezoneruleversionnumber", type: "Integer" });
    fieldList.push({ logicalname: "modifiedonbehalfby", type: "Lookup" });
    fieldList.push({ logicalname: "donotemail", type: "Boolean" });
    fieldList.push({ logicalname: "territorycode", type: "Picklist" });
    fieldList.push({ logicalname: "aging60", type: "Money" });
    fieldList.push({ logicalname: "traversedpath", type: "String" });
    fieldList.push({ logicalname: "creditlimit_base", type: "Money" });
    fieldList.push({ logicalname: "yominame", type: "String" });
    fieldList.push({ logicalname: "industrycode", type: "Picklist" });
    fieldList.push({ logicalname: "openrevenue_state", type: "Integer" });
    fieldList.push({ logicalname: "primarysatoriid", type: "String" });
    fieldList.push({ logicalname: "name", type: "String" });
    fieldList.push({ logicalname: "entityimageid", type: "Uniqueidentifier" });
    fieldList.push({ logicalname: "donotphone", type: "Boolean" });
    fieldList.push({ logicalname: "businesstypecode", type: "Picklist" });
    fieldList.push({ logicalname: "primarytwitterid", type: "String" });
    fieldList.push({ logicalname: "createdbyexternalparty", type: "Lookup" });
    fieldList.push({ logicalname: "shippingmethodcode", type: "Picklist" });
    fieldList.push({ logicalname: "paymenttermscode", type: "Picklist" });
    fieldList.push({ logicalname: "preferredequipmentid", type: "Lookup" });
    fieldList.push({ logicalname: "createdonbehalfby", type: "Lookup" });
    fieldList.push({ logicalname: "transactioncurrencyid", type: "Lookup" });
    fieldList.push({ logicalname: "accountratingcode", type: "Picklist" });
    fieldList.push({ logicalname: "fax", type: "String" });
    fieldList.push({ logicalname: "masterid", type: "Lookup" });
    fieldList.push({ logicalname: "sic", type: "String" });
    fieldList.push({ logicalname: "ownerid", type: "Owner" });
    fieldList.push({ logicalname: "stageid", type: "Uniqueidentifier" });
    fieldList.push({ logicalname: "accountnumber", type: "String" });
    fieldList.push({ logicalname: "revenue_base", type: "Money" });
    fieldList.push({ logicalname: "merged", type: "Boolean" });
    fieldList.push({ logicalname: "owneridtype", type: "EntityName" });
    fieldList.push({ logicalname: "modifiedbyexternalparty", type: "Lookup" });
    fieldList.push({ logicalname: "defaultpricelevelid", type: "Lookup" });
    fieldList.push({ logicalname: "ftpsiteurl", type: "String" });
    fieldList.push({ logicalname: "aging90_base", type: "Money" });
    fieldList.push({ logicalname: "lastonholdtime", type: "DateTime" });
    fieldList.push({ logicalname: "createdby", type: "Lookup" });
    fieldList.push({ logicalname: "openrevenue_date", type: "DateTime" });
    fieldList.push({ logicalname: "marketcap_base", type: "Money" });
    fieldList.push({ logicalname: "tickersymbol", type: "String" });
    fieldList.push({ logicalname: "customersizecode", type: "Picklist" });
    fieldList.push({ logicalname: "participatesinworkflow", type: "Boolean" });
    fieldList.push({ logicalname: "stockexchange", type: "String" });
    fieldList.push({ logicalname: "preferredserviceid", type: "Lookup" });
    fieldList.push({ logicalname: "preferredcontactmethodcode", type: "Picklist" });
    fieldList.push({ logicalname: "importsequencenumber", type: "Integer" });
    fieldList.push({ logicalname: "telephone2", type: "String" });
    fieldList.push({ logicalname: "versionnumber", type: "BigInt" });
    fieldList.push({ logicalname: "preferredsystemuserid", type: "Lookup" });
    fieldList.push({ logicalname: "accountid", type: "Uniqueidentifier" });
    fieldList.push({ logicalname: "telephone1", type: "String" });
    fieldList.push({ logicalname: "aging30_base", type: "Money" });
    fieldList.push({ logicalname: "preferredappointmentdaycode", type: "Picklist" });
    fieldList.push({ logicalname: "opendeals", type: "Integer" });
    fieldList.push({ logicalname: "statecode", type: "State" });
    for (var i = 0; i < fieldList.length; i++) {
        accountModel.fields[fieldList[i].logicalname] = {};
        MK.ModelKit.FieldProperty(accountModel.fields[fieldList[i].logicalname], fieldList[i].logicalname, fieldList[i].type);
    }


    return accountModel;
}